﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMCaLamViecDAO
    {
        public bool m_Insert(DMCaLamViecDTO _info)
        {
            int istop = 0;
            if (_info.BbNgungSuDung == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMCaLamViec_Insert  N'{0}',N'{1}',{2}", _info.STenCaLamViec, _info.SGhiChu, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMCaLamViecDTO _info)
        {
            int istop = 0;
            if (_info.BbNgungSuDung == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMCaLamViec_Update {0},N'{1}',N'{2}',{3}", _info.IIDCaLamViec, _info.STenCaLamViec, _info.SGhiChu, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMCaLamViecDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMCaLamViec_Delete {0}", _info.IIDCaLamViec);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMCaLamViec_()
        {
            string _sql = string.Format("usp_ThuNgan_DMCaLamViec_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql);
        }
        public DataTable m_SelectAllDMCaLamViec()
        {
            string _sql = string.Format("usp_ThuNgan_DMCaLamViec_SelectAll_SuDung");
            return Uit.it_SQL.getDataTable(_sql);
        }


    }
}
